package com.gxa.eshops.portal.controller;

import com.gxa.eshops.portal.thread.UserThreadLocal;
import com.gxa.eshps.cores.common.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @program: IntelliJ IDEA
 * @description:
 * @author: Mr.Wang
 * @create: 2022-07-07 14:20
 **/
@RestController
@RequestMapping("/cart")
@Api(tags = "购物车接口")
public class CartController {

    @PostMapping("/create")
    @ApiOperation("创建购物车")
    public Map<String ,Object> selectById(Long id){
        JsonResult jsonResult = new JsonResult();
        jsonResult.setCode("1");
        Object user = UserThreadLocal.get();
        jsonResult.setData(user);
        UserThreadLocal.remove();
        return jsonResult.getMap();
    }
}
